//
//  JGChooseDateView.m
//  JGRider
//
//  Created by 单启志 on 2018/2/26.
//  Copyright © 2018年 ffq. All rights reserved.
//

#import "JGChooseDateView.h"
#import <MOFSPickerManager.h>
@interface JGChooseDateView()
@property (weak, nonatomic) IBOutlet UIView *dateView;
@property (weak, nonatomic) IBOutlet UILabel *dateLab;

@end
@implementation JGChooseDateView

-(instancetype)initWithFrame:(CGRect)frame{
    if (self=[super initWithFrame:frame]) {
        self=[[[NSBundle mainBundle]loadNibNamed:NSStringFromClass([self class]) owner:nil options:nil]lastObject];
        self.frame=frame;
        [self initSubViews];
    }
    return self;
}

-(void)awakeFromNib{
    [super awakeFromNib];
    [self initSubViews];
}

-(void)initSubViews{
    self.dateView.layer.borderColor=HEXCOLOR(0xb3b3b3).CGColor;
    self.dateView.layer.borderWidth=0.5;
}

//选择日期
- (IBAction)onChooseBtnClick:(id)sender {

    [MOFSPickerManager shareManger].datePicker.locale = [NSLocale localeWithLocaleIdentifier:@"zh"];
    [[MOFSPickerManager shareManger]showDatePickerWithTag:0 title:@"请选择日期" cancelTitle:@"取消" commitTitle:@"选择" datePickerMode:UIDatePickerModeDate commitBlock:^(NSDate *date) {
        self.dateLab.text=[date stringWithFormat:@"yyyy-MM-dd"];
        

    } cancelBlock:^{

    }];
    
}


-(void)layoutSubviews{
    [super layoutSubviews];
}

@end
